/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* 主题背景样式 */
body.theme-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.theme-warm {
    background: linear-gradient(135deg, #d4a574 0%, #8b4513 100%);
}

body.theme-minimal {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body.theme-elegant {
    background: linear-gradient(135deg, #ffeef8 0%, #f8e8ff 100%);
    font-family: 'Georgia', 'Times New Roman', 'KaiTi', serif;
}

body.theme-ocean {
    background: linear-gradient(135deg, #e0f2fe 0%, #0ea5e9 100%);
    font-family: 'Segoe UI', 'Roboto', 'PingFang SC', sans-serif;
}

body.theme-forest {
    background: linear-gradient(135deg, #f0fdf4 0%, #16a34a 100%);
    font-family: 'Georgia', 'Times New Roman', 'KaiTi', serif;
}

body.theme-sunset {
    background: linear-gradient(135deg, #fff7ed 0%, #ea580c 100%);
    font-family: 'Georgia', 'Times New Roman', 'KaiTi', serif;
}

body.theme-lavender {
    background: linear-gradient(135deg, #faf5ff 0%, #9333ea 100%);
    font-family: 'Georgia', 'Times New Roman', 'KaiTi', serif;
}

body.theme-cherry {
    background: linear-gradient(135deg, #fdf2f8 0%, #ec4899 100%);
    font-family: 'Georgia', 'Times New Roman', 'KaiTi', serif;
}

body.theme-mint {
    background: linear-gradient(135deg, #f0fdfa 0%, #059669 100%);
    font-family: 'Segoe UI', 'Roboto', 'PingFang SC', sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* 主题头部样式 */
body.theme-elegant .header {
    background: rgba(255, 238, 248, 0.95);
    border: 1px solid rgba(214, 51, 132, 0.2);
}

body.theme-ocean .header {
    background: rgba(224, 242, 254, 0.95);
    border: 1px solid rgba(3, 105, 161, 0.2);
}

body.theme-forest .header {
    background: rgba(240, 253, 244, 0.95);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

body.theme-sunset .header {
    background: rgba(255, 247, 237, 0.95);
    border: 1px solid rgba(234, 88, 12, 0.2);
}

body.theme-lavender .header {
    background: rgba(250, 245, 255, 0.95);
    border: 1px solid rgba(147, 51, 234, 0.2);
}

body.theme-cherry .header {
    background: rgba(253, 242, 248, 0.95);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

body.theme-mint .header {
    background: rgba(240, 253, 250, 0.95);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

body.theme-warm .header {
    background: rgba(254, 252, 248, 0.95);
    border: 1px solid rgba(139, 69, 19, 0.2);
}

body.theme-minimal .header {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
/* 编辑器和预览区域 */
.editor-section,
.preview-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* 主题编辑器和预览区域样式 */
body.theme-elegant .editor-section,
body.theme-elegant .preview-section {
    background: rgba(255, 238, 248, 0.95);
    border: 1px solid rgba(214, 51, 132, 0.1);
}

body.theme-ocean .editor-section,
body.theme-ocean .preview-section {
    background: rgba(224, 242, 254, 0.95);
    border: 1px solid rgba(3, 105, 161, 0.1);
}

body.theme-forest .editor-section,
body.theme-forest .preview-section {
    background: rgba(240, 253, 244, 0.95);
    border: 1px solid rgba(22, 163, 74, 0.1);
}

body.theme-sunset .editor-section,
body.theme-sunset .preview-section {
    background: rgba(255, 247, 237, 0.95);
    border: 1px solid rgba(234, 88, 12, 0.1);
}

body.theme-lavender .editor-section,
body.theme-lavender .preview-section {
    background: rgba(250, 245, 255, 0.95);
    border: 1px solid rgba(147, 51, 234, 0.1);
}

body.theme-cherry .editor-section,
body.theme-cherry .preview-section {
    background: rgba(253, 242, 248, 0.95);
    border: 1px solid rgba(236, 72, 153, 0.1);
}

body.theme-mint .editor-section,
body.theme-mint .preview-section {
    background: rgba(240, 253, 250, 0.95);
    border: 1px solid rgba(5, 150, 105, 0.1);
}

body.theme-warm .editor-section,
body.theme-warm .preview-section {
    background: rgba(254, 252, 248, 0.95);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

body.theme-minimal .editor-section,
body.theme-minimal .preview-section {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(108, 117, 125, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 1.3rem;
    color: #333;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* 编辑器样式 */
#editor {
    width: 100%;
    height: 500px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#editor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 预览区域样式 */
.preview-content {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    height: 500px;
    overflow-y: auto;
    background: white;
    transition: all 0.3s ease;
}

.mobile-preview {
    max-width: 375px;
    margin: 0 auto;
}

.desktop-preview {
    max-width: 100%;
}

/* 主题选择器 */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-selector label {
    font-size: 0.9rem;
    color: #666;
}

.theme-selector select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.preview-mode {
    display: flex;
    gap: 5px;
}

.copy-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.copy-options .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* 预览内容主题样式 */
.preview-content.theme-default {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.8;
}

.preview-content.theme-warm {
    font-family: Georgia, serif;
    color: #5d4e37;
    background: #fefcf8;
    line-height: 1.8;
}

.preview-content.theme-minimal {
    font-family: 'Helvetica Neue', sans-serif;
    color: #2c3e50;
    line-height: 1.7;
}

/* 优雅粉色主题 */
.preview-content.theme-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #5d4e75;
    background: linear-gradient(135deg, #ffeef8 0%, #f8e8ff 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-elegant h1,
.preview-content.theme-elegant h2,
.preview-content.theme-elegant h3 {
    color: #d63384;
    text-shadow: 0 1px 2px rgba(214, 51, 132, 0.1);
}

.preview-content.theme-elegant blockquote {
    border-left: 4px solid #f8d7da;
    background: rgba(248, 215, 218, 0.2);
    color: #721c24;
}

.preview-content.theme-elegant code {
    background: #f8d7da;
    color: #721c24;
}

/* 海洋蓝调主题 */
.preview-content.theme-ocean {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: #1e3a8a;
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-ocean h1,
.preview-content.theme-ocean h2,
.preview-content.theme-ocean h3 {
    color: #0369a1;
    text-shadow: 0 1px 2px rgba(3, 105, 161, 0.1);
}

.preview-content.theme-ocean blockquote {
    border-left: 4px solid #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    color: #0c4a6e;
}

.preview-content.theme-ocean code {
    background: #bae6fd;
    color: #0c4a6e;
}

/* 森林绿意主题 */
.preview-content.theme-forest {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #14532d;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-forest h1,
.preview-content.theme-forest h2,
.preview-content.theme-forest h3 {
    color: #16a34a;
    text-shadow: 0 1px 2px rgba(22, 163, 74, 0.1);
}

.preview-content.theme-forest blockquote {
    border-left: 4px solid #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.preview-content.theme-forest code {
    background: #bbf7d0;
    color: #15803d;
}

/* 夕阳橙红主题 */
.preview-content.theme-sunset {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #9a3412;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-sunset h1,
.preview-content.theme-sunset h2,
.preview-content.theme-sunset h3 {
    color: #ea580c;
    text-shadow: 0 1px 2px rgba(234, 88, 12, 0.1);
}

.preview-content.theme-sunset blockquote {
    border-left: 4px solid #f97316;
    background: rgba(249, 115, 22, 0.1);
    color: #c2410c;
}

.preview-content.theme-sunset code {
    background: #fed7aa;
    color: #c2410c;
}

/* 薰衣草紫主题 */
.preview-content.theme-lavender {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #581c87;
    background: linear-gradient(135deg, #faf5ff 0%, #e9d5ff 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-lavender h1,
.preview-content.theme-lavender h2,
.preview-content.theme-lavender h3 {
    color: #9333ea;
    text-shadow: 0 1px 2px rgba(147, 51, 234, 0.1);
}

.preview-content.theme-lavender blockquote {
    border-left: 4px solid #a855f7;
    background: rgba(168, 85, 247, 0.1);
    color: #6b21a8;
}

.preview-content.theme-lavender code {
    background: #e9d5ff;
    color: #6b21a8;
}

/* 樱花粉嫩主题 */
.preview-content.theme-cherry {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #be185d;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-cherry h1,
.preview-content.theme-cherry h2,
.preview-content.theme-cherry h3 {
    color: #ec4899;
    text-shadow: 0 1px 2px rgba(236, 72, 153, 0.1);
}

.preview-content.theme-cherry blockquote {
    border-left: 4px solid #f472b6;
    background: rgba(244, 114, 182, 0.1);
    color: #be185d;
}

.preview-content.theme-cherry code {
    background: #fce7f3;
    color: #be185d;
}

/* 薄荷清新主题 */
.preview-content.theme-mint {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: #064e3b;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    line-height: 1.8;
    border-radius: 12px;
    padding: 20px;
}

.preview-content.theme-mint h1,
.preview-content.theme-mint h2,
.preview-content.theme-mint h3 {
    color: #059669;
    text-shadow: 0 1px 2px rgba(5, 150, 105, 0.1);
}

.preview-content.theme-mint blockquote {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.preview-content.theme-mint code {
    background: #ccfbf1;
    color: #047857;
}

/* 预览内容元素样式 - 优化字体大小 */
.preview-content {
    font-size: 16px; /* 基础字体大小设为16px，最适合阅读 */
    line-height: 1.75; /* 优化行高，提升阅读体验 */
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    line-height: 1.4;
}

.preview-content h1 {
    font-size: 1.75rem; /* 28px，主标题 */
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.3em;
}

.preview-content h2 {
    font-size: 1.5rem; /* 24px，二级标题 */
    color: #667eea;
}

.preview-content h3 {
    font-size: 1.25rem; /* 20px，三级标题 */
    color: #764ba2;
}

.preview-content h4 {
    font-size: 1.125rem; /* 18px，四级标题 */
    color: #555;
}

.preview-content h5,
.preview-content h6 {
    font-size: 1rem; /* 16px，五六级标题 */
    color: #666;
}

.preview-content p {
    margin: 1em 0;
    text-align: justify;
    font-size: 1rem; /* 16px，正文字体 */
    line-height: 1.75;
}

.preview-content strong {
    color: #e74c3c;
    font-weight: 600;
}

.preview-content em {
    color: #8e44ad;
    font-style: italic;
}

.preview-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem; /* 14px，代码字体稍小 */
    color: #e74c3c;
}

.preview-content pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    border-left: 4px solid #667eea;
}

.preview-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.preview-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 1em 0;
    color: #666;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 0 8px 8px 0;
}

.preview-content ul,
.preview-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.preview-content li {
    margin: 0.5em 0;
}

.preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-content th,
.preview-content td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.preview-content th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.preview-content tr:hover {
    background: #f8f9fa;
}

/* 功能特性区域 */
.features {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* 主题功能区域样式 */
body.theme-elegant .features,
body.theme-elegant .usage-guide {
    background: rgba(255, 238, 248, 0.95);
    border: 1px solid rgba(214, 51, 132, 0.1);
}

body.theme-ocean .features,
body.theme-ocean .usage-guide {
    background: rgba(224, 242, 254, 0.95);
    border: 1px solid rgba(3, 105, 161, 0.1);
}

body.theme-forest .features,
body.theme-forest .usage-guide {
    background: rgba(240, 253, 244, 0.95);
    border: 1px solid rgba(22, 163, 74, 0.1);
}

body.theme-sunset .features,
body.theme-sunset .usage-guide {
    background: rgba(255, 247, 237, 0.95);
    border: 1px solid rgba(234, 88, 12, 0.1);
}

body.theme-lavender .features,
body.theme-lavender .usage-guide {
    background: rgba(250, 245, 255, 0.95);
    border: 1px solid rgba(147, 51, 234, 0.1);
}

body.theme-cherry .features,
body.theme-cherry .usage-guide {
    background: rgba(253, 242, 248, 0.95);
    border: 1px solid rgba(236, 72, 153, 0.1);
}

body.theme-mint .features,
body.theme-mint .usage-guide {
    background: rgba(240, 253, 250, 0.95);
    border: 1px solid rgba(5, 150, 105, 0.1);
}

body.theme-warm .features,
body.theme-warm .usage-guide {
    background: rgba(254, 252, 248, 0.95);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

body.theme-minimal .features,
body.theme-minimal .usage-guide {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(108, 117, 125, 0.1);
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* 使用指南 */
.usage-guide {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.usage-guide h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #333;
}

.usage-guide ol {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.usage-guide li {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar {
        width: 100%;
        justify-content: space-between;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    #editor,
    .preview-content {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .editor-section,
    .preview-section {
        padding: 15px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 滚动条样式 */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}